﻿CREATE TABLE [dbo].[AW_Unit] (
    [UnitId]       UNIQUEIDENTIFIER NOT NULL,
    [CountryId]    UNIQUEIDENTIFIER NOT NULL,
    [StateId]      UNIQUEIDENTIFIER NOT NULL,
    [LocationId]   UNIQUEIDENTIFIER NOT NULL,
    [RoadId]       UNIQUEIDENTIFIER NOT NULL,
    [ProjectId]    UNIQUEIDENTIFIER NULL,
    [UnitFormat]   NVARCHAR (100)   NOT NULL,
    [CreateDate]   DATETIME         NOT NULL,
    [StatusDelete] TINYINT          NOT NULL,
    CONSTRAINT [PK_AW_Unit] PRIMARY KEY CLUSTERED ([UnitId] ASC),
    CONSTRAINT [FK_AW_Unit_AW_Country] FOREIGN KEY ([CountryId]) REFERENCES [dbo].[AW_Country] ([CountryId]),
    CONSTRAINT [FK_AW_Unit_AW_Location] FOREIGN KEY ([LocationId]) REFERENCES [dbo].[AW_Location] ([LocationId]),
    CONSTRAINT [FK_AW_Unit_AW_Road] FOREIGN KEY ([RoadId]) REFERENCES [dbo].[AW_Road] ([RoadId]),
    CONSTRAINT [FK_AW_Unit_AW_State] FOREIGN KEY ([StateId]) REFERENCES [dbo].[AW_State] ([StateId])
);

